// components/cheer/cheer.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    tis: {
      type: String,
      value: '',
    },
    showContinue: {
      type: Boolean,
      value: true,
    }
  },
  lifetimes: {
    attached() {
      this.randomNum();
    },
  },

  /**
   * 组件的初始数据
   */
  data: {
    dataNum: 2,
  },

  /**
   * 组件的方法列表
   */
  methods: {
    exit(e) {
      var that = this;
      wx.redirectTo({
        url: "../home/home",
      });
    },
    closeChe() {
      this.triggerEvent("closeChe", true);
    },
    randomNum() {
      const randomVal = Math.floor(Math.random() * (5 - 2 + 1)) + 2;
      console.log("randomNum", randomVal);
      this.setData({
        dataNum: randomVal,
      });
    },
  },
});
